home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3854 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.6 KB

  1. Path: rz.uni-karlsruhe.de!ma2s2!haible
  2. From: haible@ma2s2.mathematik.uni-karlsruhe.de (Bruno Haible)
  3. Newsgroups: comp.lang.lisp,comp.lang.c++
  4. Subject: Re: Why garbage collection?
  5. Date: 26 Jan 1996 11:33:16 GMT
  6. Organization: University of Karlsruhe, Germany
  7. Message-ID: <4eae5s$66p@nz12.rz.uni-karlsruhe.de>
  8. References: <rvillDL4v3n.I8r@netcom.com> <hbaker-2201961503250001@10.0.2.15>
  9. NNTP-Posting-Host: ma2s2.mathematik.uni-karlsruhe.de
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=iso-8859-1
  12. Content-Transfer-Encoding: 8bit
  13. Keywords: garbage collection, c++, tradition
  14. Originator: haible@ma2s2
  15.  
  16. Prof. Henry Baker <hbaker@netcom.com> wrote:
  17. >
  18. > The other thing I'd like to do is to ask the ACM to embargo any textbooks
  19. > that continue to prattle on about how bad GC is.  Unfortunately, these
  20. > textbooks lend credence to the old adage "If you can, do; if you can't,
  21. > write a bad textbook".
  22.  
  23. Please start with the textbook "C++ for C programmers", by Ira Pohl,
  24. 2nd edition. On page 268, he writes:
  25.  
  26.   " Other complexity issues are fundamental to the C++ language design,
  27.   such as the lack of garbage collection (GC). Several proposals exist
  28.   [4][5][6], and their implementations support the contention that they
  29.   can be done without degrading performance in most applications. Most
  30.   other major OOP languages, such as Smalltalk, CLOS, and Eiffel, support
  31.   GC. The argument for GC is that it makes the programmer's task distinctly
  32.   easier. Memory leaks and pointer errors are common when each class
  33.   provides for its own storage management. These are very hard errors to
  34.   find and debug. GC is a well-understood technology, so why not?
  35.  
  36.   " The argument against GC is that it extracts a hidden cost from all
  37.   users when employed universally. Also, GC manages memory but not other
  38.   resources. This would require destructors for _finalization_.
  39.   Finalization is the return of resources and other behavior when an
  40.   object's lifetime is over. For example, the object might be a file,
  41.   and finalization might require closing the file. Finally, it is not
  42.   in the tradition of the C community to have free store managed
  43.   automatically."
  44.  
  45.   [4] Hans-J. Boehm and Mark Weiser. "Garbage Collection in an Uncooperative
  46.       Environment." Software - Practice and Experience, Sept. 1988,
  47.       pp. 807-820.
  48.  
  49.   [5] Daniel Edelson and Ira Pohl. "A Copying Collector for C++." In
  50.       Usenix C++ Conf. Proc. 1991, pp. 85-102.
  51.  
  52.   [6] Daniel Edelson. "A Mark and Sweep Collector for C++." In Proc. Princ.
  53.       Prog. Lang., January 1992.
  54.  
  55.  
  56. Just look at the technical strength of the argument that GC is not
  57. "in the tradition of the C community"...
  58.  
  59.                    Bruno Haible
  60.  
  61.